package flextv.data {

import flextv.core.vo.Playlist;
import flextv.core.vo.StoredItem;

import mx.collections.ArrayCollection;
	

public class MockPersistenceService implements IPersistenceService {
	
	private static var DATA: ArrayCollection;
	
	public function MockPersistenceService() {
		if(DATA == null) {
			const si1: StoredItem = new StoredItem("3kszI4jfK8", "stored item dummy #1", 8, "file:///Users/phudy/Library/Preferences/FlexTV/Local Store/videos/dummy.flv");
			si1.downloaded = 100;
			
			const p1: Playlist = new Playlist("playlist dummy #1", new ArrayCollection([ si1 ]));
			
			DATA = new ArrayCollection([ p1 ]);
		}
	}
	public function close(): void {
		trace("MOCK is not going to close anything!");
	}
	public function open(): void {
		trace("MOCK is not going to open anything!");
	}
	
	public function isYidAlreadyStored(yid: String): Boolean {
		return false;
	}

	public function deletePlaylist(playlist: Playlist): void {
		trace("MOCK is not going to delete playlist: " + playlist);
	}

	public function deleteStoredItem(storedItem: StoredItem): void {
		trace("MOCK is not going to delete storedItem: " + storedItem);
	}
	public function fetchPlaylists(): ArrayCollection {
		return DATA;
	}
	
	public function updatePlaylist(playlist: Playlist): void {
		trace("MOCK update playlist: " + playlist);
	}
	
	public function updateStoredItem(storedItem: StoredItem): void {
		trace("MOCK update storedItem: " + storedItem);
	}

	public function insertPlaylist(playlist: Playlist): void {
		trace("MOCK is not inserting playlist!");
	}
	
	public function insertStoredItem(storedItem: StoredItem, playlist: Playlist): void {
		trace("MOCK is not inserting stored item!");
	}
}
}